home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / bbs_util / tgdev301.zip / DEVEL301.DOC next >
Text File  |  1996-06-09  |  67KB  |  1,310 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.                         Telegard 3.0 Development Kit (v3.01)
  15.  
  16.  
  17.                                June 9th, 1996
  18.  
  19.  
  20.                      Copyright 1995,1996 by Tim Strike.
  21.                             All rights reserved.
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.      INTRODUCTION                                                        I
  29.      _____________________________________________________________________
  30.  
  31.      PREFACE
  32.  
  33.          This documentation was designed to help utility developers find
  34.          information regarding Telegard data files and formats with
  35.          relative ease and speed.
  36.  
  37.          This kit is a revision to the 3.0 kit as released, and documents
  38.          the changes from gamma-1 through the final 3.0 release.
  39.  
  40.          Before developing utilities for Telegard, it would be appreciated
  41.          if this document was thoroughly read.  This documentation contains
  42.          several discussion sections which outline methods, procedures and
  43.          data file formats.  The discussion section explains all of the
  44.          data files that Telegard maintains, and how to access the data
  45.          and what must be done to properly access the information therein.
  46.  
  47.          It is imperative that important items in this document are
  48.          followed when developing utilities for use with Telegard.  By
  49.          following these specifications and helpful hints, you reduce the
  50.          chance of producing a poorly written/working utility.
  51.  
  52.          Telegard 3.0 brought about a major revision in the way that many
  53.          of the data files are used.  You will find that many of the files
  54.          with the same name no longer use the same data format; please
  55.          ensure that even when UPDATING utilities that you look at the
  56.          information which is provided for each file type (if they are not
  57.          listed under major headings in the DEVELOPMENT DISCUSSION section,
  58.          they will be listed under the heading OTHER FILES).
  59.  
  60.          After the discussion section follows a section on distribution.
  61.          This section outlines the best ways to document your work, the
  62.          best ways to ensure accurate distribution and even how to access
  63.          the Telegard File Distribution Network, which will distribute your
  64.          files across North America and overseas and give you the widest
  65.          distribution for nothing more then a simple phone call to one of
  66.          the development sites (provided that your distribution package
  67.          follows the simple guidelines that are set forth in this section).
  68.  
  69.          We urge the development of quality utilities for Telegard 3.0.  We
  70.          also urge you to look over this document in it's entirety so that
  71.          you will be able to accomplish your goal of writing a utility
  72.          which works properly and efficiently with Telegard.
  73.  
  74.  
  75.      CONTACT INFORMATION
  76.  
  77.          The best way to contact the Telegard development team is through
  78.          our support conference on Fidonet, TG_SUPPORT.  In this conference
  79.          we will answer all questions relating to Telegard and Telegard
  80.          third-party utility development.
  81.  
  82.          The next best way is to contact us through Fidonet/Internet
  83.          netmail.
  84.  
  85.          The author of this document can be reached via the following
  86.          addresses:
  87.  
  88.                  Fidonet    1:259/423
  89.                  Internet   ts@gryn.org
  90.  
  91.                  Telegard BBS Development
  92.                  11-3360 Council Ring Rd
  93.                  Mississauga, ON
  94.                  L5L 2E4
  95.  
  96.          Please feel free to contact us with regard to Telegard utility
  97.          development -- questions relating to data file format, access or
  98.          any other questions are welcomed.
  99.  
  100.  
  101.      INCLUDED FILES
  102.  
  103.          Several files have been included in this package.  If any of these
  104.          files are missing, please obtain a new development package from
  105.          one of our development sites.
  106.  
  107.                 DEVEL301.DOC    Telegard 3.0 Development Documentation (3.01)
  108.                 README.TG       'Read-Me' Information
  109.  
  110.                 TELEGARD.H      C/C++ structure file
  111.                 TELEGARD.INC    Turbo/Borland Pascal structure file
  112.                 TEXT_ADF.TXT    Text File Description - Archive Definitions
  113.                 TEXT_MDF.TXT    Text File Description - Modem Definitions
  114.                 TEXT_PDF.TXT    Text File Description - Protocol Definitions
  115.  
  116.                 FILE_ID.DIZ     Automated package description
  117.                 PACKING.LST     Package file listing
  118.  
  119.  
  120.      DEVELOPMENT DISCUSSION                                             II
  121.      _____________________________________________________________________
  122.  
  123.      SOURCE CODE EXAMPLES
  124.  
  125.          Secondary packages will be released at a later date which provide
  126.          source code examples to many of the topics discussed in this
  127.          document.  If at the time of this reading the packages are not yet
  128.          available, please feel free to contact us with regards to any 
  129.          questions.
  130.  
  131.          The reason that the source code examples are not provided with
  132.          this release is relatively simple -- source code examples can be
  133.          improved and extended, and as a result, we've chosen to release
  134.          Telegard coding 'magazine' type packages, where new examples will
  135.          be provided and where common questions can be answered on a
  136.          regular basis.
  137.  
  138.          The first package should be released shortly, and will contain
  139.          preliminary code examples in both Pascal and C/C++.  If you have
  140.          problems you would like to see source code answers for, or have
  141.          questions you would like to ask regarding programming with
  142.          Telegard, please ensure that you contact us so that we can look
  143.          them over for the next source code package.
  144.  
  145.          The source code packages will likely take the filenames 
  146.          TGDEV@nn.ZIP where @ will be an alphanumeric volume number (A=1, 
  147.          B=2, etc) and nn is the release in that volume.  Announcements 
  148.          will be made when these packages are released.
  149.  
  150.  
  151.      TELEGARD 3.0
  152.  
  153.          Telegard 3.0 was developed in Borland Pascal 7.0 -- with portions
  154.          compiled in C and Assembly.
  155.  
  156.          All the Telegard 3.0 internal data structures use standard pascal 
  157.          methods and constructors, and this should be noted by utility 
  158.          developers who will use other languages.  Structures which are 
  159.          external to Telegard 3.0 (i.e. data files which other programs 
  160.          create and Telegard just uses, things like JAM, Squish, etc.) use 
  161.          either C or Pascal methods and constructors; ensure that you 
  162.          determine which is which and make the necessary adjustments in 
  163.          your programs.
  164.         
  165.  
  166.      DATE FORMATS
  167.  
  168.          Telegard 3.0 uses two different types of date formats; the first
  169.          is a simple string format and the second is a Unix timestamp.
  170.  
  171.          STRING DATE FORMAT    --   --   --   --   --   --   --   --   --
  172.  
  173.          The string dates are always in the same format (MM/DD/YY) and are
  174.          converted to other formats on the fly.  This date format is stored
  175.          in a string of length 8.
  176.  
  177.          UNIX DATE FORMAT --   --   --   --   --   --   --   --   --   --
  178.  
  179.          The second date format is a Unix timestamp.  Effectively this is
  180.          the number of seconds since midnight, January 1st, 1970.  Several
  181.          compilers and implementations use different algorithms to
  182.          calculate the date format.  Telegard uses the local system time
  183.          (i.e. the time on the machine) and calculates the number of
  184.          seconds since midnight, January 1st, 1970, including the extra
  185.          days during all leap years (which some implementations ignore).
  186.          No adjustments are made for timezone, and no conversion is done
  187.          to Greenwich Mean Time (GMT).
  188.  
  189.  
  190.      CONFIGURATION FILES
  191.  
  192.          Data file CONFIG.TG   --   --   --   --   --   --   --   --   --
  193.  
  194.          The main configuration is stored in CONFIG.TG in the main BBS
  195.          directory.  This file contains all paths and all necessary
  196.          configuration items that pertain to operation and selection of the
  197.          BBS' features.  The CONFIG.TG file can be opened and modified;
  198.          please note that modifications to the file will not immediately be
  199.          loaded into memory in a multinode environment.  If another task
  200.          overwrites the file contents, another node could still overwrite
  201.          and replace those contents at another time.
  202.  
  203.          The hiddenPW field should *never* be updated by an external 
  204.          utility, as the consequences of doing this could be very dire.
  205.  
  206.          Data file SYSTEM.DAT  --   --   --   --   --   --   --   --   --
  207.  
  208.          Telegard 3.0 introduces a secondary configuration file, which
  209.          contains all the SYSTEM variables, and thus, is called SYSTEM.DAT
  210.          (stored in the /DATA/ directory).  The SYSTEM.DAT file is very
  211.          sensitive to changes, and thus, the following procedure must be
  212.          followed (in single node or multinode environments):
  213.  
  214.                (1) Open file
  215.                (2) Obtain a lock on the entire files contents - if
  216.                        lock can not be obtained, cycle for waiting period
  217.                        abort w/error if still unable
  218.                (3) Read the current data record into memory
  219.                (4) Update record (do *NOT* sit idle waiting for input
  220.                        or other processes)
  221.                (5) Write the new information to the file
  222.                (6) Unlock file contents, close file
  223.  
  224.          The information in this record must be current, and always must be
  225.          accessed by only one source at a time, which is why the above
  226.          procedure must be followed.
  227.  
  228.  
  229.      SEARCHING INDEXES
  230.  
  231.          Several of the data files used in Telegard 3.0 are indexed to make
  232.          searching for data quicker and easier to accomplish.  The index
  233.          files, marked with TG_INDEX in the structures, contain different
  234.          information but are all built and maintained the same way.
  235.  
  236.          The purpose of the index files (*.IDX) is to ensure quick access
  237.          to the information.  The index file design used in Telegard
  238.          facilitates not only the searching of existing records, but also
  239.          the addition of new records.
  240.  
  241.          The records in the index files all contain some data [key] and
  242.          a number location [offset].  The [key] is used to find the
  243.          correct record, and the [offset] can be used with another file
  244.          to directly load the necessary information.
  245.  
  246.          The index files (*.IDX) have two distinct sections; the first is a
  247.          sorted database, and the second part is an unsorted database (used
  248.          primarily for additions to the index).  A binary search is used
  249.          for the first section, and a sequential search for the second
  250.          section.  The binary search uses the sorted characteristic to
  251.          chop the search area in half each time; this results in a very
  252.          quick search of the sorted section of the database.  If the [key]
  253.          can not be found there, the sequential search will check through
  254.          the small unsorted portion.  If the [key] is not found there, the
  255.          [key] does not exist.  The important thing to note about this
  256.          indexing method is that the sorted database will be significantly
  257.          large compared to the unsorted portion.  Frequent updates of the
  258.          database using the indexing utilities provided with Telegard will
  259.          ensure that the fastest searching time is always maintained.
  260.  
  261.          When the index files are first built, all valid records will be
  262.          added to the file and sorted.  When new records are created, the
  263.          records will be added to the end of the database and remain there
  264.          until index maintenance is completed.
  265.  
  266.          The first record in the index files contains the record offset
  267.          of the first unsorted record.  This is important to note, since
  268.          the binary search should ONLY be run on the database starting at
  269.          record #1 and ending at the last sorted record.  The sequential
  270.          search should start at the first unsorted record and end at the
  271.          last record in the index file.
  272.  
  273.                 Record 0      Unsorted index record [offset=NS]
  274.                 Record 1      First sorted record, if NS <> 1
  275.                 Record NS-1   Last sorted record
  276.                 Record NS     First unsorted record -- could be <EOF>
  277.                 to <EOF>      Last unsorted record
  278.  
  279.          To search for a [key] the following procedure should be followed:
  280.  
  281.               1. Read record #0, store [offset]=NS
  282.               2. Binary search on record #1 through record NS-1.
  283.                      If [key] found, skip to FOUND.
  284.               3. Sequential search of record NS through <EOF>.
  285.                      If [key] found, skip to FOUND.
  286.               4. [key] does not exist, skip to END.
  287.           FOUND. If [offset] = -1, [key] does not exist, skip to END.
  288.                  Otherwise, [key] exists, use [offset] to find data.
  289.             END.
  290.  
  291.          The indexing methods used in Telegard 3.0 provide fast and
  292.          efficient loading and manipulation of the data.  There are other
  293.          ways to search for information, but if the index files exist for
  294.          the information you are looking for, they are the best way to find
  295.          the information.
  296.  
  297.          ADDING INDEX RECORDS  --   --   --   --   --   --   --   --   --
  298.  
  299.          Search the index to see if a record already exists for that [key].
  300.          If it does exist, there are two possibilities (a) this is an
  301.          adjusting record, in which case adjust the [offset] field and
  302.          rewrite the record or (b) this [key] already exists and does not
  303.          need to be added, or can not be added.  If is does not exist,
  304.          simply create the necessary record and then write it to the end
  305.          of the index file (simple, eh?).
  306.  
  307.          REMOVING INDEX RECORDS     --   --   --   --   --   --   --   --
  308.  
  309.          Search the index for the necessary [key] - if a record already
  310.          exists, set the [offset] field to -1 and rewrite the record.  If
  311.          the record doesn't exist, it can't be deleted now can it (smile).
  312.  
  313.  
  314.      USERS
  315.  
  316.          Telegard 3.0 no longer uses USER NUMBERS to find records in the
  317.          data files.  Record #2, therefore, is not User #2 like older
  318.          versions of Telegard had implemented.
  319.  
  320.          USER-ID     --   --   --   --   --   --   --   --   --   --   --
  321.  
  322.          Since user numbers were no longer tied to user records, a user-id
  323.          was created to give each user a 'id-tag' that was not associated
  324.          with user/real names (since those change frequently).  The user-id
  325.          number is generated when the user first logs on and is ordered
  326.          sequentially from 1 (i.e. the first available user-id after 0 is
  327.          assigned to the new user).  This user-id field is only used to
  328.          reference the user' records in other files.  It is *not*
  329.          associated with the users data file position; i.e. user-id #2 is
  330.          not necessarily found in record position #2.
  331.  
  332.          PASSWORD TEXT/CRC FIELDS   --   --   --   --   --   --   --   --
  333.  
  334.          The pwtext field *may* be empty.  Please observe the following 
  335.          when updating passwords:
  336.  
  337.          1. All password input is UPPERCASE
  338.  
  339.          2. If ConfigRec.HiddenPW = TRUE, then only the CRC32 of the 
  340.             password is stored in the user record (userrec.crcpw). 
  341.  
  342.          3. If ConfigRec.HiddenPW = FALSE, both the CRC32 and the actual
  343.             password are stored in the user record.
  344.  
  345.         *4. When checking input passwords against the file, only the CRC32
  346.             value should be tested (the pwtext may or may not be correct).  
  347.             If ConfigRec.HiddenPW = FALSE, and the pwtext field is EMPTY, 
  348.             then after a correct password the field will be automatically
  349.             updated.  If ConfigRec.HiddenPW = TRUE, the pwtext will *not* be 
  350.             updated (this is obvious).
  351.  
  352.         *5. Passwords should *only* be displayed (pwtext) if the CRC32 of
  353.             the pwtext field *matches* the pwcrc field.  Otherwise, the 
  354.             pwtext field is likely incorrect.  When changing passwords, the
  355.             user should be prompted only, not shown their previous password.
  356.  
  357.         *6. The CRC32 calculation used by Telegard is a standard CRC32
  358.             calculation.  The initial value is 0xFFFFFFFF (FFFFFFFFh)
  359.             and only the contents of the password are uses (i.e. start at
  360.             position 1, not 0 (the length byte).  Remember, the passwords
  361.             are in uppercase.
  362.  
  363.          Data file USERS.DAT   --   --   --   --   --   --   --   --   --
  364.  
  365.          The USERS.DAT data file has no specific order, except that the
  366.          SysOp Record must be record #0.  The data file may be sorted in
  367.          any manner that is deemed important, except that record #0 should
  368.          never be moved; that is the only restriction to the order of the
  369.          file.
  370.  
  371.          Data file USERS.IDX  [TG_INDEX] --   --   --   --   --   --   --
  372.  
  373.          To speed up data searches a USERS.IDX file has been created
  374.          (replacing NAMES.LST from older versions of Telegard).  The index
  375.          file contains both user aliases and real names (if different) so
  376.          that searches can be completed using either one.  The offset
  377.          provided in the index record is the record position offset in
  378.          USERS.DAT.
  379.  
  380.          Data file USERID.IDX  [TG_INDEX]     --   --   --   --   --   --
  381.  
  382.          To speed up associative data searches, a USERID.IDX file has been
  383.          created.  The index file contains the userid's of all active users
  384.          so that searches can be completed by finding the matching id.  The
  385.          offset provided in the index record is the record position offset
  386.          in USERS.DAT.
  387.  
  388.          SEARCHING FOR USERS   --   --   --   --   --   --   --   --   --
  389.  
  390.          Use the index files to quickly search for users (user name/alias
  391.          or id) or use a sequential search on USERS.DAT to search for other
  392.          fields.
  393.  
  394.          DELETING USERS   --   --   --   --   --   --   --   --   --   --
  395.  
  396.          Deleting users from the database is a relatively simple task, but
  397.          has many associated items which must be properly executed for the
  398.          data files to be tidy and efficient.
  399.  
  400.               (1) Remove user records from *.IDX files (see section on
  401.                      TELEGARD INDEXES - REMOVING INDEX RECORDS )
  402.               (2) Remove all email (base 0) to user
  403.               (3) Remove all shortmsgs (SHORTMSG.DAT) to user
  404.               (4) Adjust voting records for user (VOTING.DAT - adjust totals)
  405.               (5) Reset all lastread pointers to ZERO
  406.               (6) Remove macro record of user (null MACRO.DAT.UserId, set
  407.                       macro pointer to -1)
  408.               (7) Set USERID field to ZERO
  409.               (8) Set udeleted in user flags
  410.  
  411.          Following those instructions will lead to the most compact data
  412.          files and ensure that data records are not accidentally
  413.          cross-linked.
  414.  
  415.          PACKING USERS    --   --   --   --   --   --   --   --   --   --
  416.  
  417.          All deleted users can be removed from the data file by simply
  418.          removing their data record (provided that the users were properly
  419.          deleted as above).  All this entails is that the users record is
  420.          overwritten with an active record, or a new data file is created
  421.          with only the active user records).
  422.  
  423.          SORTING USERS    --   --   --   --   --   --   --   --   --   --
  424.  
  425.          Since the dependency on user numbers no longer exists, user
  426.          records can be sorted in any manner with any method.  The only
  427.          restriction (as noted above) is that Record #0 must remain as
  428.          Record #0 at all times (it should *not* be sorted).
  429.  
  430.  
  431.      MESSAGES
  432.  
  433.          Telegard 3.0 no longer uses proprietary message formats, but
  434.          instead uses the standard formats SQUISH and JAM.  These two
  435.          formats provide standard access to the message bases, are
  436.          considerably more adaptable and provide similar performance to
  437.          the old Telegard formats without losing compatibility.
  438.  
  439.          Data file MAREAS.DAT  --   --   --   --   --   --   --   --   --
  440.  
  441.          The MAREAS.DAT data file stores all the datafile definitions for
  442.          Telegard message bases.  There are only a few areas of note in the
  443.          record format which will be outlined shortly.  The message bases
  444.          are stored in numerical order (i.e. base #1 is record #1) -- this
  445.          number will correspond to the message base number within Telegard
  446.          unless the base compression tables are on (this will have to be
  447.          handled differently by other utilities).
  448.  
  449.              *  If the FileName is blank, the message base is not active
  450.                 and should not be processed.
  451.              *  The *.MSI, JAM/Squish files will be stored in the MsgPath
  452.                 field -- if they are not there, create them there.
  453.              *  The QwkIndex field should be a permanent number which
  454.                 should not be changed except for extreme repair procedures
  455.                 or for controlled maintenance purposes; the QwkIndex field
  456.                 is best changed by the indexing utility provided with
  457.                 Telegard.
  458.  
  459.              *  When changing a FileName the MAREAS.IDX file should be
  460.                 updated; the old record should be deleted and the new
  461.                 record should be created (see section on TELEGARD INDEXES -
  462.                 ADDING AND REMOVING INDEX RECORDS).
  463.              *  Similarly, if and when changing a QwkIndex number, the
  464.                 QWK.IDX file must be updated in the same fashion.
  465.  
  466.          Data file MAREAS.IDX  [TG_INDEX]     --   --   --   --   --   --
  467.  
  468.          The MAREAS.IDX file contains the base filenames and file offsets
  469.          into the file MAREAS.DAT for those bases.  This file can be used
  470.          to quickly locate a specific base by filename.
  471.  
  472.          Data file QWK.IDX  [TG_INDEX]   --   --   --   --   --   --   --
  473.  
  474.          The QWK.IDX file contains the QWK base numbers (QwkIndex) and the
  475.          file offsets into the file MAREAS.DAT for those bases.  This file
  476.          can be used to quickly locate a specific base by QwkIndex number.
  477.  
  478.          Data file *.MSI  --   --   --   --   --   --   --   --   --   --
  479.  
  480.          The *.MSI data files contain the base selection tables for all
  481.          users.  To find the scan record for any user, the offset in the
  482.          *.MSI file is userrec.userid-1 (so if the userid = 2, the offset =
  483.          1 and therefore the record position = 1).
  484.  
  485.          JAM FORMAT  --   --   --   --   --   --   --   --   --   --   --
  486.  
  487.          The JAM format uses an expandable record format which essentially
  488.          allows it to grow as needed for application purposes.  The purpose
  489.          of this section is not to outline how JAM works (the JAM API
  490.          released by the authors of JAM provides code examples and a text
  491.          development document) but rather to just quickly outline the
  492.          format and some assumptions used with Telegard 3.0.
  493.  
  494.          The *.JHR file contains most of the information that is required
  495.          for messages.  The first record contains information about the
  496.          base that is being looked at.  The records afterward are variable
  497.          in length because of the numerous subfields that may or may not
  498.          exist for each message:
  499.  
  500.             jaminforec
  501.                jamhdrrec[1]
  502.                   subfield[1]
  503.                   subfield character buffer
  504.                      :
  505.                   subfield[n]
  506.                   subfield character buffer
  507.                jamhdrrec[2]
  508.                   :
  509.                jamhdrrec[n]
  510.  
  511.          The subfield codes used by Telegard 3.0 match all the standard JAM
  512.          subfield codes.
  513.  
  514.          ** NOTE: For bases where anonymous, anyname, etc postings are
  515.          used, the sender/receiver names will be "anonymous", "anyname",
  516.          etc.  The FTS-kludge "^aREALNAME: <name>" will be used to store
  517.          the posting users name (which will depend on the realname/alias
  518.          toggled on the base).  This kludge uses the standard subfield-id
  519.          of 2000.
  520.  
  521.          JAM stores its own lastread pointers in the *.JLR files.  To find
  522.          the correct lastread record for any user, a sequential search for
  523.          the matching user-id should be done.
  524.  
  525.          SQUISH FORMAT    --   --   --   --   --   --   --   --   --   --
  526.  
  527.          The Squish format is another dynamic message base, which allocates
  528.          itself in data chunks (frames) and links itself on the fly.  The
  529.          Squish bases automatically attempt to pack themselves for all
  530.          newly posted or incoming messages, which alleviates the job of
  531.          running a packer each night for the Squish message format (it is
  532.          however a good idea to run the packer on a frequent basis to
  533.          remove the unused frames and reduce disk usage (even at the lowest
  534.          level)).
  535.  
  536.          The Squish format is outlined well by it's author in the SQUISH
  537.          API package, which includes a comprehensive discussion of the
  538.          Squish format and methods for reading, writing and indexing the
  539.          message areas.
  540.  
  541.          The Squish format uses it's own lastread pointers, stored in the
  542.          *.SQL files.  To find the lastread record for any user, the offset
  543.          in the *.SQL file is userrec.userid-1 (so if the userid = 2, the
  544.          offset = 1 and therefore the record position = 1).
  545.  
  546.          QWK OFFLINE MAIL FORMAT    --   --   --   --   --   --   --   --
  547.  
  548.          Telegard 3.0 implements the QWK mail format as per the QWK
  549.          specifications (covered well in the document package dealing with
  550.          the QWK layout, normally distributed with filenames similar to
  551.          QWKLAYnn.ZIP, where nn is the revision number (the latest at the
  552.          time of this release was nn=17).
  553.  
  554.          Data file *.QPT  --   --   --   --   --   --   --   --   --   --
  555.  
  556.          Telegard 3.0 also adds it's own pointer file, *.QPT which stores
  557.          the lastread pointers for the requested message bases.  This file
  558.          only contains the QWK base number and the lastread number, and is
  559.          sent with the QWK offline mail package to the user.
  560.  
  561.  
  562.     FILES
  563.  
  564.          Telegard 3.0 uses a proprietary file base format, since there are
  565.          few standard filebase formats which are suitable and efficient.
  566.  
  567.          Data file FAREAS.DAT  --   --   --   --   --   --   --   --   --
  568.  
  569.          The FAREAS.DAT data file stores all the datafile definitions for
  570.          Telegard file bases.  There are only a few areas of note in the
  571.          record format which will be outlined shortly.  The file bases are
  572.          stored in numerical order (i.e. base #1 is record #1) -- this
  573.          number will correspond to the file base number within Telegard
  574.          unless the base compression tables are on (this will have to be
  575.          handled differently by other utilities).
  576.  
  577.              *  If the FileName is blank, the file base is not active
  578.                 and should not be processed.
  579.              *  The *.FSI, *.FB and *.FBE files will be stored in the
  580.                 FilePath field -- if they are not there, create them there.
  581.              *  Files are actually stored in the path pointed to be
  582.                 FAreaRec.Path.  Offline files are obviously not here.
  583.                 Check CD-ROM status to check access for writing to this
  584.                 path (read-only toggle means no writing!).
  585.              *  Telegard keeps track of CD-ROM titles that are in the
  586.                 drive at the current time - if the FAreaRec.CdLabel field
  587.                 contains a value and the area is toggled as CD-ROM Telegard
  588.                 will check the drive for the correct CD-ROM before trying
  589.                 to download/access.
  590.  
  591.              *  When changing a FileName the FAREAS.IDX file should be
  592.                 updated; the old record should be deleted and the new
  593.                 record should be created (see section on TELEGARD INDEXES -
  594.                 ADDING AND REMOVING INDEX RECORDS).
  595.  
  596.          Data file FAREAS.IDX  [TG_INDEX]     --   --   --   --   --   --
  597.  
  598.          The FAREAS.IDX file contains the base filenames and file offsets
  599.          into the file FAREAS.DAT for those bases.  This file can be used
  600.          to quickly locate a specific base by filename.
  601.  
  602.          Data file *.FSI  --   --   --   --   --   --   --   --   --   --
  603.  
  604.          The *.FSI data files contain the base selection tables for all
  605.          users.  To find the scan record for any user, the offset in the
  606.          *.FSI file is userrec.userid-1 (so if the userid = 2, the offset =
  607.          1 and therefore the record position = 1).
  608.  
  609.          Data file *.FB   --   --   --   --   --   --   --   --   --   --
  610.  
  611.          The *.FB data files contain the actual file records for the files
  612.          that are available and currently in that file base.  File records
  613.          are stored with a variable length description (which will be
  614.          touched on later).
  615.  
  616.          Unlike previous versions of Telegard, record #0 is now used for
  617.          file records.  Deleted records are completely removed from the
  618.          file instead of sitting at the end of the file (like previous
  619.          versions as well).
  620.  
  621.          The fields in the file records are not updated on the fly; if a
  622.          file is moved offline external to Telegard, then Telegard will not
  623.          know this unless the file has its status changed.
  624.  
  625.          Data file *.FBE  --   --   --   --   --   --   --   --   --   --
  626.  
  627.          The *.FBE data files contain the extended file descriptions (the
  628.          variable length portion).  Records with blank filenames are unused
  629.          records and can be reused by other utilities.  If the entire
  630.          record (5 lines) is not needed for a description, null the other
  631.          description entries (i.e. fill with #0) - or at least ensure that
  632.          their string length is 0.
  633.  
  634.          Variable Length Descriptions    --   --   --   --   --   --   --
  635.  
  636.          As mentioned before, Telegard stores the file records with
  637.          variable length descriptions.  Although the system requires a
  638.          linked list, when the list is maintained properly, Telegard can
  639.          handle descriptions of up to 26 lines internally (and essentially,
  640.          unlimited amounts externally).
  641.  
  642.          The descriptions are organized as follows:
  643.  
  644.          File (FBREC)
  645.             Description                       { first line of description }
  646.             Extended                          { pointer to first extended }
  647.                                               { description, -1=none }
  648.          Extended (FBEXTREC)
  649.             Filename                          { used to verify correct link }
  650.             Desc                              { next 5 lines of description }
  651.                                               { if null'' line, ignore rest }
  652.                                               { blank lines should contain }
  653.                                               { at least one space }
  654.             Nextlink                          { pointer to next extended }
  655.                                               { description, -1=none }
  656.          Description*
  657.          File.Extended -> Desc*
  658.                           Extended.NextLink -> Desc*
  659.                                                Extended.Nextlink -> -1
  660.  
  661.          The description lines (*) can then be composed (in this example)
  662.          of up to 11 lines (1+5+5).  The description ends when the nextlink
  663.          is -1.
  664.  
  665.          Data file FILES.IDX  [TG_INDEX] --   --   --   --   --   --   --
  666.  
  667.          The data file FILES.IDX contains a listing of all the filenames
  668.          that are currently available on the system.  It can be used to
  669.          check for duplicate files, to find files quickly (i.e. Request
  670.          Processors) or many other useful tasks.  The file *must* be
  671.          maintained properly.  If a file by the same filename already
  672.          exists in the index, the utility should determine which is the
  673.          correct entry and use that (for this reason, two files can not
  674.          have the same filename -- it's a good thing to follow, regardless
  675.          of whether or not they are in different file directories).
  676.  
  677.          IMPORTANT NOTE:  As of Telegard 3.0, the fileidxrec.filerecord
  678.          field is not being used - to find the file, just open the filebase
  679.          and perform a sequential search of the records.  The file offset 
  680.          field will be implemented at a later date.
  681.  
  682.          ADDING FILES     --   --   --   --   --   --   --   --   --   --
  683.  
  684.          When adding a file to a directory, the index should first be
  685.          checked for an existing filename.  If the file already exists, the
  686.          utility should either (a) replace the old file with the new file,
  687.          removing the old file if necessary from other areas or (b) abort
  688.          adding the new file to the database.
  689.  
  690.          To add a file, simply write it's record into the correct *.FB
  691.          file.  If the file has an extended description, update the
  692.          FBRec.Extended pointer and link the description into the *.FBE
  693.          file.  Then add the file into the FILES.IDX (see information on
  694.          Telegard Indexes - Adding Index Records).
  695.  
  696.          DELETING FILES   --   --   --   --   --   --   --   --   --   --
  697.  
  698.          A little more care should be taken when deleting files.  First,
  699.          if the file has extended description records, those description
  700.          records must have their filenames set to null (empty string) --
  701.          just follow the link through and set all corresponding filenames.
  702.          After this has been complete, the file should be removed from the
  703.          *.FB file (rewrite all records after that record to their current
  704.          position-1, truncate the last record from the file -- this ensures
  705.          that the order of the *.FB file is maintained).  Finally, the
  706.          record must be removed from the FILES.IDX file (see information on
  707.          Telegard Indexes - Removing Index Records).  The file should be
  708.          removed from the filepath if (a) necessary and (b) if possible.
  709.  
  710.          Data File PROTOCOL.DAT and Transfer Protocols  --   --   --   --
  711.  
  712.          Telegard maintains the transfer protocols in a file called
  713.          PROTOCOL.DAT.  Internally to Telegard, the protocols are referred
  714.          to as A-Z (i.e. 26 protocols can be stored in Telegard - one
  715.          record per protocol type).  Unlike previous versions of Telegard,
  716.          single, batch and resume protocols no longer require separate
  717.          records.  Record #0 refers to Protocol A, and record #25 refers to
  718.          Protocol Z.  All the protocol records are created in the file at
  719.          once, even if they are not used.
  720.  
  721.          If the ProtRec.Batch field is toggled TRUE, then the files will be
  722.          compiled into a filelist and this filelist will be sent as the
  723.          protocol filename (~PF).  Most protocols require a special flag to
  724.          list this file as a 'list' of files - this should be stored in the
  725.          ProtRec.flist field.  If the ProtRec.Bidirec field is toggled
  726.          TRUE, Telegard will search the temporary incoming directory for
  727.          files after the download.
  728.  
  729.          If ProtRec.Desc field is null, the protocol has not been defined.
  730.  
  731.          Data file *.QQQ, *.QQD and --   --   --   --   --   --   --   --
  732.          Upload and Download Queues
  733.  
  734.          The upload/download queues are stored in the temporary directory
  735.          as the files *.QQQ and *.QQD.  The upload/download queues store
  736.          information about flagged files that are pending upload or
  737.          download by the user.  Information may be added/removed from these
  738.          queues during a shell since the queues will be re-processed after
  739.          the shell.
  740.  
  741.          The maximum number of queued files is maxqueue, any entries after
  742.          the maxqueue number will not be read by Telegard.
  743.  
  744.          The extended descriptions queues (*.QQD) use the same format as
  745.          the filearea extended description files (*.FBE).
  746.  
  747.          Data file TESTINFO.DAT     --   --   --   --   --   --   --   --
  748.  
  749.          TESTINFO.DAT is a file that is created by virus scanners and
  750.          upload processors.  It includes information on file conversions,
  751.          descriptions, testing information, etc.  Telegard will read this
  752.          file (if toggled on) to process conversions and get information
  753.          regarding the file testing that has just occurred (after the virus
  754.          scanner has been run on the file).
  755.  
  756.          Records which are not scanned for a period of time can be removed
  757.          from the TESTINFO.DAT file - this indicates that errors have
  758.          occurred with the importation of these file records.
  759.  
  760.          THDPRO V11 and subsequent versions will produce this file.  At the
  761.          time of this writing, this is the only known product to use the
  762.          format.  Telegard will only work with THDPRO V11, since prior
  763.          versions do not include the TG3.0 product code.
  764.  
  765.  
  766.      OTHER FILES
  767.  
  768.          If the data file is not listed below, then no extra information is
  769.          required to access the data file; the record format is straight
  770.          forward, and the data is not organized in any varying manner
  771.          (usually there is only one record).
  772.  
  773.          Data file *.MNU  --   --   --   --   --   --   --   --   --   --
  774.  
  775.          The menu files are stored in a number of different paths; the
  776.          first being the default *.MNU path, stored in CONFIG.TG.  The
  777.          other paths are language specific paths (for more information see
  778.          section LANGUAGE CONSIDERATIONS).
  779.  
  780.          The menu files have a base header (MenuRec) and are followed by up
  781.          to MaxMenuCommands of the menu command records (CommandRec).  The
  782.          *.MNU files must be opened in non-record specific file formats
  783.          (i.e. for those Turbo Pascal people, define the type as FILE and
  784.          use BLOCKREAD/BLOCKWRITE to access the records).
  785.  
  786.          Data file *.BBS  --   --   --   --   --   --   --   --   --   --
  787.  
  788.          The BBSlisting files are stored in the ConfigRec.DataPath and
  789.          contain the BBS listing entries.  To add an entry, add to the end
  790.          of the file.  To remove an entry, physically remove the record.
  791.          If updating the entry, be sure to touch the BBSListRec.LastEdit
  792.          field with the current date.  MCI codes should be removed from all
  793.          BBSlist entries.
  794.  
  795.          Data file ARCHIVE.DAT --   --   --   --   --   --   --   --   --
  796.  
  797.          Telegard maintains the archivers in a file called ARCHIVE.DAT.
  798.          Internally to Telegard, the archivers are referred to as 1-MaxArcs
  799.          (i.e. MaxArcs archivers be stored in Telegard - one record per
  800.          archive type).  Record #0 refers to Archiver #1, Record #1 to
  801.          Archiver #2, etc.  All the archive records are created in the file
  802.          at once, even if they are not used.
  803.  
  804.          If ArchiveRec.Extension field is null, the archiver has not been
  805.          defined.
  806.  
  807.          Data file EVENTS.DAT  --   --   --   --   --   --   --   --   --
  808.  
  809.          The events that Telegard maintains are stored in the file
  810.          EVENTS.DAT.  This file contains an array of all the events:
  811.          Event(#1) - Event(MaxEvents) and includes a reserved record
  812.          Event(#0) which is used for processing external events.
  813.  
  814.          If the event is forced, users will be kicked off when the event
  815.          time occurs.  If the event is not forced, users will be allowed to
  816.          stay on past the duration of the event and the event will be run
  817.          afterwards.
  818.  
  819.          If Telegard is loaded from an external program (Mailer, external
  820.          call answer door, etc.) the Telegard events will still be adhered
  821.          to.  If the External Event command line is used (-X[n]) then
  822.          Telegard will also include this event time in its event
  823.          calculations.
  824.  
  825.          Data file GROUPS.DAT  --   --   --   --   --   --   --   --   --
  826.  
  827.          The groups that Telegard maintains are stored in the file 
  828.          GROUPS.DAT.  This file contains an array of all the groups: Group 
  829.          @ is record #0, Group A is record #1, etc.
  830.  
  831.          If GroupsRec.Name field is null, the group has not been defined.
  832.  
  833.          Data file HISTORY.DAT --   --   --   --   --   --   --   --   --
  834.  
  835.          Telegard stores the call information in a file called HISTORY.DAT.
  836.          Unlike previous versions of Telegard in which this file was stored
  837.          in reverse order, Telegard 3.0 stores this file in ascending order
  838.          - i.e. the first record is the oldest record, the last record is
  839.          the newest record.
  840.  
  841.          To find the current days entry, check the last record in the file.
  842.          If the dates do not match up, the daily turnover event has not
  843.          been run; a new record can be created for the new day (this will
  844.          however result in Telegard not processing it's turnover events,
  845.          which include packing away the SysOp logs and other minor
  846.          maintenance processes) or the old record can be added to.
  847.  
  848.          Data file IEMSI.DAT   --   --   --   --   --   --   --   --   --
  849.  
  850.          The IEMSI.DAT data file is created in the \temp directory only if
  851.          a user connects with IEMSI.  The file contains the IEMSI record as
  852.          Telegard has processed the incoming IEMSI information.  At the end
  853.          of this record will be the actual buffer dump of the IEMSI
  854.          handshaking package which was received by the system - just in
  855.          case for some reason it is required or needed.
  856.  
  857.          The IEMSI buffer/protocol contains several fields which Telegard
  858.          can not process (either lack of functionality, or no real purpose
  859.          to process).  See the record structure for specific entries which
  860.          Telegard will not do anything with.
  861.  
  862.          Data file LANGUAGE.DAT     --   --   --   --   --   --   --   --
  863.  
  864.          The LANGUAGE.DAT file contains entries for all active languages
  865.          that have been defined for the system.  There are a couple of
  866.          fields of note which should be looked at when searching to load
  867.          menus or to display text files -- Telegard searches the language
  868.          specific entries first, and then if that fails, looks at the
  869.          default entries (if the language is setup to do that):
  870.  
  871.                      LANGUAGEREC RECORD              CONFIGREC RECORD
  872.                                              YES
  873.          START -> Is path field empty/null? -----> Search for file in
  874.                            |                   |   default path (MenuPath/
  875.                        NO  |                   |   TextPath).
  876.                            |                   |   File found? -----> Use
  877.                   Search for file in defined   |       |        YES
  878.              YES  path (MenuPath/TextPath).    |    NO |
  879.        Use <----- File found?                  |       |
  880.                            |                   |   File does not exist.
  881.                            | NO                |
  882.                            |                   |
  883.                   Check defined boolean for    |
  884.                   further searching.           |
  885.                   (CheckMenus/CheckText).      |
  886.                   Boolean = TRUE --------------'
  887.                            |
  888.                         NO |
  889.                            |
  890.                        File does not exist.
  891.  
  892.          The actual language text is stored in the *.TGL file with the
  893.          filename LanguageRec.Filename.  There are more considerations for
  894.          Telegard 3.0 with it's new multilingual capabilities; see the
  895.          section titled LANGUAGE CONSIDERATIONS.
  896.  
  897.          Data file LASTON.DAT  --   --   --   --   --   --   --   --   --
  898.  
  899.          The LASTON.DAT file is kept in sequential order - the last record
  900.          is therefore the newest record, and the first record is the
  901.          oldest.
  902.  
  903.          The LCallers record is written when the user first logs on.  The
  904.          LCallers.Caller field is used to update the record when the user
  905.          logs off to include the logoff time and download totals.
  906.  
  907.          If writing a utility which handles this information, please
  908.          observe the HIDDEN flag for any records that are going to be
  909.          displayed, and only display to the users with Co-SysOp ACS or
  910.          above.
  911.  
  912.          Data file LEVELS.DAT  --   --   --   --   --   --   --   --   --
  913.  
  914.          Telegard maintains the validation levels in a file called
  915.          LEVELS.DAT.  Internally to Telegard, the levels are referred to as
  916.          A-Z (i.e. 26 levels can be stored in Telegard). Record #0 refers
  917.          to Level A, and record #25 refers to Level Z.  All the level
  918.          records are created in the file at once, even if they are not
  919.          used.
  920.  
  921.          If LevelsRec.Desc field is null, the level has not been defined.
  922.  
  923.          Data file MACRO.DAT   --   --   --   --   --   --   --   --   --
  924.  
  925.          Telegard stores the macros in this file.  When searching for a
  926.          users macro record, check UserRec.MacroPtr and check there for the
  927.          macro offset.  If this record does not match the correct User-ID,
  928.          then set the UserRec.MacroPtr field to -1.  The order of the
  929.          macros in the array is alphabetical; ^D,^E,^F and ^R.
  930.  
  931.          Data file MODEM.DAT/MODEMnnn.DAT     --   --   --   --   --   --
  932.  
  933.          Modem information for single node boards is stored in MODEM.DAT.
  934.  
  935.          For multinode boards, the default modem information is stored in
  936.          MODEM.DAT (will be used for all new node entries).  Each node uses
  937.          the file MODEMnnn.DAT where nnn is the node number of that node.
  938.  
  939.          Telegard 3.0 uses VERBOSE result codes instead of NUMERIC result
  940.          codes.  This should make the configuration of modems considerably
  941.          easier.  If Telegard detects the ModemRec.Code_ARQ string in the
  942.          connect string then the connection is considered Error Correcting.
  943.          The modems are very sensitive to the ModemRec.Delay* fields;
  944.          adjusting these fields even slightly will affect most modems
  945.          considerably.
  946.  
  947.          Telegard 3.0 stores the IRQ/Base I/O address for the port.  These
  948.          are purely informational for Telegard - since TG uses the fossil
  949.          drivers, non-standard ports are addressed through the fossil 
  950.          driver.  However, GSZ/DSZ and several other protocols access the
  951.          ports directly and may need this information on a per-node basis.        
  952.  
  953.          For more multinode considerations, see the section titled
  954.          MULTINODE CONSIDERATIONS.
  955.  
  956.          Data file NODES.DAT   --   --   --   --   --   --   --   --   --
  957.  
  958.          Stores information on the node configuration (acs, logon times,
  959.          phone numbers) and the whos online information for each user.
  960.          The status text can be freely modified (it's displayed with an
  961.          MCI code in the language file) -- as long as the statusid is
  962.          correctly maintained for each node.
  963.  
  964.          Data file SHORTMSG.DAT/INODEnnn.MSG  --   --   --   --   --   --
  965.  
  966.          When searching for short messages to a user, search the file for
  967.          matching user-id fields -- the messages are in no particular
  968.          order, so the entire file will need to be sequentially searched.
  969.  
  970.          The status ID should always be 0 for all external Telegard 
  971.          utilities.  Telegard itself uses this field for internal transfer
  972.          stubs, and using a value other than 0 for external utilities can
  973.          potentially cause many problems.
  974.  
  975.          To send a message to an online user for them to read, write the
  976.          message to the appropriate INODEnnn.MSG file.  If the user logs
  977.          off before the message is received, it will be deleted.
  978.  
  979.          To delete the short message (when deleting a user or after the
  980.          message has been sent to the user), set the ShortMsgRec.UserId
  981.          field to 0 (instead of the normal -1 as most other deleted records
  982.          do).
  983.  
  984.          Do not delete short messages from the INODEnnn.MSG file.  Telegard
  985.          will clean these up as neccessary (on the next login to that 
  986.          node).
  987.  
  988.          Data file TIMELOG.DAT --   --   --   --   --   --   --   --   --
  989.  
  990.          The TIMELOG.DAT data file contains the time tracking graphs that
  991.          each of the nodes maintains.  For single node systems, Record #0
  992.          is the only record that is maintained.  For multinode systems,
  993.          Record #0 is for Node#1, Record #1 is for Node#2, etc.
  994.  
  995.          The actual format of the data is not too significant, however:
  996.  
  997.              TimeLogRec.BusyPerHour contains the number of minutes in
  998.              each hour breakdown that the node has been active for all
  999.              days during the week.
  1000.  
  1001.              TimeLogRec.BusyPerDay breaks down that information into 20
  1002.              minute chunks for separate days of the week.  Both fields
  1003.              should be updated, rolling time past midnight if necessary.
  1004.              While it is possible to calculate the TimeLogRec.BusyPerHour
  1005.              fields from the TimeLogRec.BusyPerDay fields on the fly, that
  1006.              wasn't the way that I implemented the structure (grin).
  1007.  
  1008.          The TIMELOG.DAT data file can be deleted to restart the time
  1009.          tracking variables -- or alternatively the entire record can be
  1010.          set to null (fill all fields with chr #0).
  1011.  
  1012.      MULTINODE CONSIDERATIONS
  1013.  
  1014.          Telegard 3.0 opens all of its files in SHARE mode -- this means
  1015.          that for a multinode environment to exist, SHARE (or the OS
  1016.          equivalent) must be loaded.  Telegard 3.0 opens most of its files
  1017.          in fmReadWrite+fmDenyNone mode, although occasionally Telegard
  1018.          uses fmRead+fmDenyNone and fmWrite+fmDenyNone.  When files are
  1019.          being critically updated, Telegard will open the file in fmDenyAll
  1020.          mode (and will only keep the file open a short period of time).
  1021.  
  1022.          A few circumstances arrive where Telegard 3.0 actually LOCKS the
  1023.          file contents; JAM, Squish and the SYSTEM.DAT file are all cases
  1024.          where this is done.  For JAM and Squish, follow their respective
  1025.          development documents, and for SYSTEM.DAT see the information
  1026.          earlier in the document.
  1027.  
  1028.          When opening files in a multinode environment, there are a few
  1029.          things to keep in mind:
  1030.  
  1031.                 (a) Open the file in fmReadWrite+fmDenyNone unless there
  1032.                     is a specific reason you need to open the file in
  1033.                     another file mode.
  1034.                 (b) All data files should be open as _little_ as possible
  1035.                     (i.e. do not keep a file open while waiting for input
  1036.                     for example).
  1037.  
  1038.          Utility authors should not ignore the existence of multinode
  1039.          systems -- if your utility can't co-exist in a multinode
  1040.          environment, please specify it is for SINGLE node systems or for
  1041.          systems which are shut down ENTIRELY for a maintenance event (i.e.
  1042.          no nodes are left active during maintenance).
  1043.  
  1044.  
  1045.      LANGUAGE SUPPORT
  1046.  
  1047.          Telegard 3.0 introduced multilingual support for the BBS -- this
  1048.          means that different language strings can be setup and chosen by
  1049.          the online user to use.
  1050.  
  1051.          While it is not necessary for Utility authors (esp. those with
  1052.          with interactive doors) to support multiple languages, keep in
  1053.          mind that your product could be used on several different language
  1054.          platforms, and multilingual support could be beneficial.
  1055.  
  1056.          There are two common ways to handle multiple languages; the first
  1057.          is to create a text file which is loaded on the fly (good for
  1058.          small amounts of text), and the second is a data file which stores
  1059.          different strings for different languages.  Both methods are
  1060.          equally useful, and both have their drawbacks.  If you intend on
  1061.          supporting multiple languages, the choice of which method to use
  1062.          is entirely up to you.
  1063.  
  1064.          You can load the current users language from their user record,
  1065.          or you can have it passed on the command line with MCI codes.  The
  1066.          choice there is also up to the utility developer.
  1067.  
  1068.          Telegard language file structure is *not* distributed at the
  1069.          present time.  If you need text strings from a Telegard language
  1070.          file, please get in touch with the development team for more
  1071.          information.  The text strings are not always at the same file
  1072.          offset, so seeking into the file to get around the lack of
  1073.          structures will not consistently work properly.
  1074.  
  1075.  
  1076.      TEXT FILE DEFINITIONS
  1077.  
  1078.          Telegard 3.0 added the ability to import text file definitions for
  1079.          archivers, protocols and modem setups.  This allows standard
  1080.          configurations to be freely distributed and installed without the
  1081.          hassle of playing with the setup, or having to input all of the
  1082.          field information.  The text file definitions can be imported and
  1083.          exported by Telegard 3.0, and the format is freely available so
  1084.          that distribution can easily occur.
  1085.  
  1086.          SysOps are encouraged to release new archive and protocol setups
  1087.          (provided they work, naturally) so that other SysOps can benefit
  1088.          from this new distribution method.
  1089.  
  1090.          The three formats (ARCHIVE, PROTOCOL and MODEM) are all discussed
  1091.          in their own document files (TEXT_ADF, TEXT_PDF, TEXT_MDF
  1092.          respectively).
  1093.  
  1094.  
  1095.      UTILITY DISTRIBUTION                                              III
  1096.      _____________________________________________________________________
  1097.  
  1098.      DISTRIBUTION TYPES
  1099.  
  1100.          When deciding to distribute your archive, there are several
  1101.          considerations you must make -- mainly dealing with what you want
  1102.          in return for your utility, etc.
  1103.  
  1104.          There are several distinct types of distribution, and several that
  1105.          fall in between categories - FREEWARE, SHAREWARE and COMMERCIAL
  1106.          SOFTWARE.  There are too many misconceptions and other conditions
  1107.          to describe each type of distribution in this document; the best
  1108.          method is to determine what you want, find a similar product and
  1109.          look at how they marketed their product.
  1110.  
  1111.      THE DISTRIBUTION ARCHIVE
  1112.  
  1113.          Most distribution archives are packed in such a way that SysOps
  1114.          can quickly look at what is inside and determine that they are
  1115.          getting everything that they need.  Some SysOps will not even
  1116.          look at your program if they are in any way suspicious of the
  1117.          contents of your distribution archive.  The following hints are
  1118.          aimed at helping you as a utility developer get the most out of
  1119.          your efforts.
  1120.  
  1121.          THE ARCHIVE FILENAME
  1122.  
  1123.          Almost all utilities will require more then one release version,
  1124.          so version numbers come in handy so that SysOps and users know
  1125.          what version of the program the current archive contains.  Thus,
  1126.          the version number normally finds its way into the filename of the
  1127.          archive, either as FFFFFFnn.EEE or FFFFFnnn.EEE depending on how
  1128.          the version numbers are represented (the first is for Vn.n, the
  1129.          second for Vn.nn -- your choice, personal freedom).  The filename
  1130.          could also contain many variations on the above format, such as
  1131.          FFnnnFFF.EEE, etc.  If at all possible, shorten your archive
  1132.          filename and add the version number to the name -- that is the
  1133.          best way to ensure that SysOps will take a look at your file.
  1134.  
  1135.          And if you generally think your utility will not have any more
  1136.          versions, give it another thought -- most do.
  1137.  
  1138.          THE ARCHIVE FORMAT
  1139.  
  1140.          The most popular archive formats are still ZIP and ARJ.  Other
  1141.          formats, such as RAR and LZH have followings in certain regions,
  1142.          but may not necessarily be used everywhere your archive may
  1143.          travel.  You are best to stick with the most popular archive 
  1144.          formats -- if you really want to deviate, consider self-extracting 
  1145.          forms of your archive choice.
  1146.  
  1147.          Also, if you are considering a self-extracting form, it is 
  1148.          suggested that you first pack your archive with the 
  1149.          self-extracting header, and then pack that .EXE file (and any 
  1150.          release notes) in a .ZIP file.  Your release notes should be 
  1151.          separated from the your self-extracting .EXE file -- some SysOps 
  1152.          read the release notes to determine if they want to look at the 
  1153.          file further.  If they only see an .EXE file, they might look the 
  1154.          other way.
  1155.  
  1156.          THE ARCHIVE CONTENTS
  1157.  
  1158.          All pieces of your program should naturally be contained in your
  1159.          archive (this includes all necessary data files, text files and
  1160.          of course the executable files).
  1161.  
  1162.          Your archive should also contain some form of documentation.  Even
  1163.          if your program doesn't do much, you should include documentation
  1164.          which at least covers the following topics: (a) a brief
  1165.          description of the program, (b) what files and versions of those
  1166.          files are required -- if any, and (c) contact information for 
  1167.          reaching the author.  The program documentation normally takes on 
  1168.          the name of the executable file with the extension of .DOC, 
  1169.          although this isn't a standard by any means.  Some software 
  1170.          distribution networks and BBSes refuse to carry files without 
  1171.          documentation -- consider this, and even if it's only a small 1k 
  1172.          file that you write, at least it ensures that your archive won't 
  1173.          be immediately deleted.
  1174.  
  1175.          Last minute release information should be put into one of several
  1176.          files; README.DOC, UPDATE.DOC or RELEASE.DOC.  These files are
  1177.          commonly searched and read before any other miscellaneous files
  1178.          are touched, so putting last minute information into these files
  1179.          is a good idea.
  1180.  
  1181.          If you wish to ensure that no files are added or removed from the
  1182.          archive, then a text listing (in both your main documentation and
  1183.          a separate file called PACKING.LST) of all the files in your
  1184.          archive is a good idea.
  1185.  
  1186.          If you wish to ensure that your archive is always described the
  1187.          way that you want it, a FILE_ID.DIZ file is a great idea (in fact,
  1188.          many popular BBSes now import the file as the file description,
  1189.          regardless of what the uploading user types in).  The FILE_ID.DIZ
  1190.          file is a text file which describes your program.  This file has a
  1191.          specific format; the maximum number of characters on any line is
  1192.          45, and the maximum number of lines is 10.  PLEASE DO NOT DEVIATE
  1193.          FROM THIS STANDARD - I REALIZE THAT OTHER AUTHORS HAVE AND JUST
  1194.          BECAUSE THEY DO DOES NOT MAKE IT RIGHT.  IF YOU WANT TO ENCLOSE A
  1195.          FILE_ID.DIZ FILE, ENCLOSE IT IN THE PROPER FORMAT.
  1196.  
  1197.          Some authors like to time stamp all the files in their archive so
  1198.          that all the files have the same date/time.  This makes it very
  1199.          easy for the author to check and see what files have been
  1200.          changed/added to the archive, by checking the file date when
  1201.          unpacking.  This obviously isn't something that everyone needs to
  1202.          do -- personal preference again.
  1203.  
  1204.          Beyond that, archives are archives.  Many authors have their own
  1205.          personal ways of building their archives and of setting up their
  1206.          distribution files.  You can be just as free with your decisions,
  1207.          just remember that when it comes to distributing your archive, you
  1208.          may be limiting your distribution if you don't put together a
  1209.          complete package.
  1210.  
  1211.      DISTRIBUTION
  1212.  
  1213.          There are several ways of distributing your final archive.  These
  1214.          ways will be discussed below so that you can determine the best
  1215.          way of getting your file out into the field.
  1216.  
  1217.          ADVERTISING
  1218.  
  1219.          The best place to advertise new utilities for Telegard is in a
  1220.          Telegard support conference.  The participants of the conference
  1221.          are mostly Telegard SysOps or other interested parties, and thus
  1222.          advertising in the support conferences will ensure that you hit
  1223.          your best (and most interested) audience.  TG_SUPPORT (our
  1224.          international Fidonet conference) is probably the best place to go
  1225.          for this advertising.  Please note however that you should 
  1226.          advertise your program only once or twice; advertising it daily 
  1227.          will unnerve many people and may turn them off of your product.
  1228.  
  1229.          FILE REQUESTS/MAIN BBS DOWNLOAD
  1230.  
  1231.          Setting up your archive for File Request (mailer) or BBS download
  1232.          ensures that people will be able to get to your file.  The problem
  1233.          with relying on this method alone means that your utility spreads
  1234.          only through direct contact (i.e. the interested SysOps must call
  1235.          your system to get the file).  This results in a very systematic
  1236.          and slow diffusion of your program -- although it's still
  1237.          recommended that you do this, there are other methods you should
  1238.          also consider.
  1239.  
  1240.          SOFTWARE DISTRIBUTION NETWORKS
  1241.  
  1242.          Software distribution networks distribute your file for you; you
  1243.          send it in to a site, which sends it to connected systems, and
  1244.          those systems send it to connected systems, etc.  This ensures
  1245.          that everyone who is connected to a specific SDN gets your file
  1246.          automatically (and in many cases, the file is automatically added
  1247.          to their file bases for download as well).  This method of
  1248.          distribution means that you program will be spread in a very
  1249.          hierarchical way, but will spread quickly and automatically -- two
  1250.          things new releases generally benefit from.
  1251.  
  1252.          There are several different distribution networks out their to
  1253.          distribute your utility.  Most networks have different categories
  1254.          for different types of files; so when choosing a network, make
  1255.          sure that they have an area for your type of utility (i.e. a
  1256.          Telegard area, or a BBS utility area).
  1257.  
  1258.          The Telegard Development Team has created a software distribution 
  1259.          network on the fidonet filebone which provides national and 
  1260.          international distribution through Fidonet channels.  This area
  1261.          has the tag name TG_SUP and should be available from your Fidonet
  1262.          hub.  If you would like your file distributed via this SDN, please
  1263.          see the section on DISTRIBUTION BY THE TELEGARD DEVELOPMENT TEAM.
  1264.  
  1265.          FTP (FILE-TRANSFER-PROTOCOL) SITES
  1266.  
  1267.          The internet provides a service called FTP, which allows for the
  1268.          collection of files over the internet.  This ensures that people
  1269.          can access your file without cost (except the cost of their
  1270.          Internet provider, if any) and at any time of the day, without
  1271.          worrying about busy signals, etc.  Although I'm not aware of most
  1272.          of the anonymous FTP sites, if you upload your utility to one of
  1273.          them into a /Telegard/ area, I am sure that you will get some
  1274.          internet users grabbing your file.
  1275.  
  1276.          The Telegard Development Team presently operates one official
  1277.          FTP site, available through FTP at ftp://filebank.com. If you
  1278.          would like your file distributed via this site, please see the 
  1279.          section on DISTRIBUTION BY THE TELEGARD DEVELOPMENT TEAM.
  1280.  
  1281.          DISTRIBUTION BY TELEGARD DEVELOPMENT TEAM 
  1282.  
  1283.          The Telegard Development Team operates many distribution sites 
  1284.          which can help distribution your utilities (TG_SUP, ftp site and
  1285.          the development sites).  To have your file distributed via our 
  1286.          distribution methods, please refer to the following "to-do" list:
  1287.  
  1288.                 (a) Ensure your program works (test!)
  1289.                 (b) Include complete documentation and contact information
  1290.                 (c) Include FILE_ID.DIZ file
  1291.                 (d) The preferred archive format is ZIP -- if you pack
  1292.                     in another format, please consider double packing so
  1293.                     that you file is ultimately in ZIP format.
  1294.                 (e) Upload to a Telegard Development Site, let the SysOp
  1295.                     know the file is there, and provide a simple one-line
  1296.                     description (this is for the actual SDN distribution)
  1297.                 (f) The file will be hatched into the TG_SUP as soon as
  1298.                     humanly possible.  Within 36 hours of that hatching,
  1299.                     the file will be placed on the FTP server.
  1300.  
  1301.  
  1302.      OTHER QUESTIONS                                                    IV
  1303.      _____________________________________________________________________
  1304.  
  1305.          If you have any further questions on topics discussed in this
  1306.          document, or even topics which were not discussed, please feel
  1307.          free to contact the author of this document or get in touch with
  1308.          one of the Telegard Development Sites.
  1309.  
  1310.